<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			function reg(){
				var xhr=new XMLHttpRequest();
				xhr.open('POST',`/pro/v1/reg`,true);
				xhr.onreadystatechange=function(){
					if(xhr.readyState==4&&xhr.status==200){
						var r=xhr.responseText;
						if(r==1){
							alert("注册成功");
							location.href="pro_list.html";
						}else{
							alert("注册失败");
						}
					}
				}
				var formdata=`uname=${uname.value}&upwd=${upwd.value}&email=${email.value}&phone=${phone.value}`;
				xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded")
				xhr.send(formdata);
			}
		</script>
	</head>
	<body>
		<input type="text" id="uname" placeholder="请输入用户名"><br>
		<input type="text" id="upwd" placeholder="请输入密码"><br>
		<input type="text" id="cpwd" placeholder="请重复输入密码"><br>
		<input type="text" id="email" placeholder="请输入邮箱"><br>
		<input type="text" id="phone" placeholder="请输入手机号"><br>
		<button onclick="reg()">注册</button>
	</body>
</html>
